{include file="public/header"}
{load href="/public/static/Content/ThemesBusiness/ListPage.css"}
<style>
    .datagrid-view {
        overflow-x: scroll;
    }
</style>
<script src="/public/static/Scripts/common-binder-list-view.js"></script>
<script src="/public/static/Scripts/ScriptsEasyui/datagrid-filter.js"></script>

<script type="text/javascript">

    var data = null;
    var gridListHandler = new listGridHandler(data, 'gridListHandler', 'gridList');
    gridListHandler.formName = '商品';
    gridListHandler.enableFilter = false;
    $(function () {
        gridListHandler.bindFilter($('#gridList'));
    });
    gridListHandler.getNewUrl = function (id) {
        return '/admin/good/add';
    };
    /* gridListHandler.getEditUrl = function(recordID) {
         return '/admin/usergroup/edit/' + recordID;
     };*/

    gridListHandler.getDeleteUrl = function (recordID) {
        return '/admin/good/del/' + recordID;

    };
    function formatState(val, row, index) {
        if (row.status == 0) {
            val = '<span style="display:inline-block;background-color:#abbac3;color:#fff;padding:1px 5px;">' +
                '正常' +
                '</span>';
        }
        else {
            val = '<span style="display:inline-block;background-color:#d15b47;color:#fff;padding:1px 5px;">' +
                '停用' +
                '</span>';
        }
        return val;
    }

    function showList(id) {
        if (id <= 0) {
            $.messager.alert('提示', "没有ID", 'info');
            return 0;
        } else {
            window.showBusinessForm("详情", '/admin/fix/details.html?id=' + id);
        }


    }

    function addStatus(id, checkstatus) {
        if (id <= 0) {
            $.messager.alert('提示', "操作失败", 'info');
            return 0;
        }

        $.messager.confirm('提示', '确定进行操作吗？', function (r) {
            if (r) {
                $.ajax({
                    type: "POST",
                    url: 'add_status.html?id=' + id + '&checkstatus=' + checkstatus,
                })
                    .success(function (result) {
                        if (result.status > 0) {
                            $.messager.alert('提示', result.msg, "info");
                            window.location.reload();
                        } else {
                            $.messager.alert('提示', result.msg, "error");
                        }
                    })
                    .error(function (result) {
                        var message = "很抱歉，操作出现异常！请联系管理员。";
                        if (result) {
                            if (result.responseJSON && result.responseJSON.ExceptionMessage) {
                                message = result.responseJSON.ExceptionMessage;
                            }
                            else if (result.responseText) {
                                message = result.responseText;
                            }
                        }

                        $.messager.alert('错误', message.replace("-10", ""), 'error');
                    });
            }
        });

    }
    function showimg(val, row, index) {
        val = '<a href="' + row.img + '">点击查看' + '</a>';
        return val;
    }
    function showvideo(val, row, index) {
        // val = '<a href="'+ row.video +'">点击查看'+'</a>';
        val = '<video src="' + row.video + '" controls="controls"></video>';
        return val;
    }

    function formatAction(val, row, index) {
        val = '<u><a href="#" onclick="showList(' + row.id + ')">' + row.fixnum + '</a></u>';
        return val;
    }

</script>
<div style="margin: 20px auto; width: 60%;">
<video src="/uploads/video/{$video}" width="100%" controls="controls">
    您的浏览器不支持 video 标签。
</video>
</div>
{include file="public/footer"/}